package com.gxa.modules.app.hospital.navigation.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.gxa.modules.app.hospital.navigation.dto.FloorDto;
import com.gxa.modules.app.hospital.navigation.dto.ParkDetailDto;
import com.gxa.modules.app.hospital.navigation.dto.ParkDto;
import com.gxa.modules.app.hospital.navigation.service.AppParkGuidanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 院区导航表 前端控制器
 * </p>
 *
 * @author yjl
 * @since 2022-11-12 10:51:34
 */
@RestController
@Api(tags = "医院导航")
@RequestMapping("/app/park-guidanc")
public class AppParkGuidanceController {

    @Autowired
    private AppParkGuidanceService parkGuidanceService;

    @ApiOperation("查询对应医院园区信息")
    @GetMapping("/query")
    public R queryParkAll(){
        List<ParkDto> parkDtos = this.parkGuidanceService.queryParkAll();
        return R.ok(parkDtos);
    }

    @ApiOperation("查询对应医院园区详细信息")
    @GetMapping("/queryById/{id}")
    public R queryById(@PathVariable("id") Integer id){
        ParkDetailDto parkDetailDto = this.parkGuidanceService.selectById(id);
        return R.ok(parkDetailDto);
    }

    @ApiOperation("查询对应医院的楼层索引")
    @PostMapping("/selectById/{id}")
    public R selectById(@PathVariable("id") Integer id){
        List<FloorDto> lists = this.parkGuidanceService.queryById(id);
        return R.ok(lists);
    }

}
